package com.lanou3g.demo.base.controller;

import com.lanou3g.demo.entity.ModuleInfo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class NavigationController {
    @RequestMapping("/navigation.do")

    public String list(Model model, HttpSession session) {
        if (session != null) {
            List<ModuleInfo> list = (List<ModuleInfo>) session.getAttribute("infoList");
            model.addAttribute("infoList", list);
            return "/navigation";
        }
        return "/login";

    }

}
